<template>
  <div class="nav-header">
    <div class="nav-left">
      <div class="logo">
        <span class="logo-text">数据中心</span>
      </div>
      <router-link 
        v-for="(route, index) in routes" 
        :key="index"
        :to="route.path"
        class="nav-item"
        :class="{ active: $route.path === route.path }"
      >
        {{ route.name }}
      </router-link>
    </div>
    <div class="nav-right">
      <span class="nav-action">
        <i class="icon">🔔</i>
        通知
      </span>
      <span class="nav-action">
        <i class="icon">📤</i>
        上传
      </span>
      <span class="nav-action user-menu">
        <i class="icon">👤</i>
        用户名 
        <span class="dropdown-arrow">▼</span>
      </span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'NavHeader',
  data() {
    return {
      routes: [
        { name: '数据列表', path: '/data-list' },
        { name: '数据分析', path: '/data-analysis' },
        // { name: '数据表格', path: '/data-compare' },
        { name: '数据对比', path: '/data-table' },
        { name: '数据获取', path: '/same-table' },
      ]
    }
  }
}
</script>

<style lang="less" scoped>
.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 50%, #2980b9 100%);
  padding: 0 30px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1000;
  backdrop-filter: blur(20px);

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
      rgba(44, 62, 80, 0.95) 0%, 
      rgba(52, 152, 219, 0.9) 50%, 
      rgba(41, 128, 185, 0.95) 100%);
    z-index: -1;
  }

  .nav-left {
    display: flex;
    align-items: center;
    gap: 5px;

    .logo {
      margin-right: 30px;
      
      .logo-text {
        font-size: 20px;
        font-weight: bold;
        background: linear-gradient(45deg, #fff, #74b9ff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      }
    }

    .nav-item {
      position: relative;
      padding: 12px 20px;
      height: 60px;
      line-height: 36px;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      text-decoration: none;
      color: #fff;
      border-radius: 8px;
      font-weight: 500;
      font-size: 14px;

      &:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      }

      &.active {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        
        &::after {
          content: '';
          position: absolute;
          bottom: 0;
          left: 50%;
          transform: translateX(-50%);
          width: 30px;
          height: 3px;
          background: linear-gradient(90deg, #74b9ff, #0984e3);
          border-radius: 2px;
        }
      }
    }
  }

  .nav-right {
    display: flex;
    gap: 15px;
    align-items: center;

    .nav-action {
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      padding: 8px 16px;
      border-radius: 25px;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      font-size: 14px;
      font-weight: 500;
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      
      .icon {
        font-size: 16px;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
      }
      
      &:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      }

      &.user-menu {
        position: relative;
        
        .dropdown-arrow {
          transition: transform 0.3s ease;
          font-size: 12px;
        }
        
        &:hover .dropdown-arrow {
          transform: rotate(180deg);
        }
      }
    }
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-header {
    padding: 0 15px;
    height: 55px;
    
    .nav-left {
      .logo {
        margin-right: 15px;
        
        .logo-text {
          font-size: 16px;
        }
      }
      
      .nav-item {
        padding: 10px 15px;
        font-size: 13px;
      }
    }
    
    .nav-right {
      gap: 10px;
      
      .nav-action {
        padding: 6px 12px;
        font-size: 13px;
      }
    }
  }
}

@media (max-width: 480px) {
  .nav-header {
    .nav-left {
      .logo .logo-text {
        display: none;
      }
    }
    
    .nav-right {
      .nav-action {
        padding: 6px 8px;
        
        span:not(.dropdown-arrow) {
          display: none;
        }
      }
    }
  }
}
</style> 